﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom;
using NHibernate.Cfg.MappingSchema;

namespace MVCGen.Generators.Entity {
	public class HbmManyToOneFieldGenerator : ICodeTypeMemberGenerator {
		private HbmManyToOne manyToOne;

		public HbmManyToOneFieldGenerator(HbmManyToOne manyToOne) {
			this.manyToOne = manyToOne;
		}

		public CodeTypeMember Generate() {
			CodeMemberField result = new CodeMemberField() {
				Name = manyToOne.name.MakeFieldName(),
				Type = new CodeTypeReference(manyToOne.@class),
				Attributes = MemberAttributes.Private
			};
			return result;
		}
	}
}
